package com.ficus.road.maintain.strategy.allfactory;

import com.ficus.road.maintain.core.model.Hit;
import lombok.NoArgsConstructor;

/**
 * @author xiawen yang
 * @date 2022/2/15 下午3:35
 */
@NoArgsConstructor
public class AllFactoryContext {

    //    private AllFactoryTypeEnum type;
//    private HitAllFactoryDao hitAllFactoryDao;
    private AllFactoryStrategy allFactoryStrategy;

//    public AllFactoryContext(HitAllFactoryDao hitAllFactoryDao, AllFactoryTypeEnum type) {
//        this.hitAllFactoryDao = hitAllFactoryDao;
//        this.type = type;
//        if (AllFactoryTypeEnum.ROAD_ICE.equals(type) || AllFactoryTypeEnum.BRIDGE_HOTEL.equals(type)) {
//            allFactoryStrategy = new IceAndBridgeStrategy(hitAllFactoryDao);
//        } else if (AllFactoryTypeEnum.OVERRUN_CAR.equals(type)) {
//            allFactoryStrategy = new OverrunCarStrategy(hitAllFactoryDao);
//        } else if (AllFactoryTypeEnum.ILLEGAL_DIGGING.equals(type)) {
//            allFactoryStrategy = new IllegalDiggingStrategy(hitAllFactoryDao);
//        } else if (AllFactoryTypeEnum.MAINTENANCE_TM_OUT.equals(type)) {
//            allFactoryStrategy = new MaintenanceTmOutStrategy(hitAllFactoryDao);
//        }
//    }

    public AllFactoryContext(AllFactoryStrategy strategy) {
        allFactoryStrategy = strategy;
    }

    public Hit convert2AllFactoryHit(Object o) {
        Hit hit = allFactoryStrategy.convert2AllFactoryHit(o);
        return hit;
    }
}
